import {
    resetRouter
} from "@/router";
import qs from "qs"
const getDefaultState = () => {
    return {
        video_url: "",
        img_url: "",
        commentList: [],
        document_url: "",
        imgList: [],
        file_code: ""
    };
};
import {
    getVideoCommentList
} from "@/api/modules/video"
const state = getDefaultState();

const mutations = {
    // 存储发布视频url
    SETVIDEOURL(state, video_url) {
        state.video_url = video_url;
    },
    // 存储发布视频封面url
    SETIMGURL(state, img_url) {
        console.log('store', img_url);
        state.img_url = img_url;
    },
    SETDOCUMENTURL(state, document_url) {
        state.document_url = document_url;
    },
    SETIMGLIST(state, imgList) {
        state.imgList = imgList
    },
    SETFILEHASH(state, file_code) {
        state.file_code = file_code
    }
};

const actions = {
    // // 获取当前评论列表
    // async getCurrentCommentList({
    //     commit
    // }, {
    //     video,
    //     limit,
    //     page
    // }) {
    //     const res = await getVideoCommentList(video.info.id, limit, page)
    //         // console.log("commentlist",res)
    //     if (res.status == 200 || res.status == 422) {
    //         commit("GETCURRENTCOMMENTLIST", res.data.payload)
    //         return "success"
    //     } else {
    //         return "error"
    //     }
    // }
};

export default {
    namespaced: true,
    state,
    mutations,
    actions,
};